<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
    <style>
        body{
            text-align: center;
        }
        .box{
            width: 200px;
            height: 200px;
            background-color: crimson;
            margin: 40px auto;
        }
    </style>
</head>
<body>
    <div class="box">

    </div>
    <button id="show">显示</button>
    <button id="hide">隐藏</button>
    <button id="toggle">切换</button>
    
</body>
<script src="../lib/jquery.min.js"></script>
<script>
    $(function(){
        $('#show').click(e =>{
            //显示div
            $('.box').show();
        });
        $('#hide').click(e =>{
            //隐藏div
            $('.box').hide();
        });
        $('#toggle').click(e =>{
            //切换div
            $('.box').toggle();
        });
        
    });
</script>
</html>